1. Field of the Invention
This invention relates to a method of recording and reproducing information on and from a disk-shaped recording medium such as an optical disk, a magnetic disk, or a magneto-optical disk. This invention also relates to an apparatus for recording and reproducing information on and from a disk-shaped recording medium such as an optical disk, a magnetic disk, or a magneto-optical disk.
2. Description of the Related Art
Japanese published unexamined patent application 6-19767 discloses a magnetic disk controller with a file restoration function. The magnetic disk controller in Japanese patent application 6-19767 includes an output control means, an output data storage means, an output control information storage means, an output state storage means, and a file restoration means. The output data storage means stores data to be outputted to the magnetic disk which is fed from a host device. The output data storage means can hold the data even when power supply is interrupted. The output control means is informed by the host device of a designated output position and an output-data length. The output control means writes the information of the designated output position and the output-data length into the output control information storage means. The output control information storage means can hold the information even when power supply is interrupted. The output control means writes a signal representative of a state of output processing into the output state storage means. The output state storage means can hold the signal even when power supply is interrupted.
The magnetic disk controller in Japanese patent application 6-19767 records data on the magnetic disk as follows. The output control means accesses a region of the magnetic disk which agrees with the designated output position. The output control means transfers the data from the output data storage means to the magnetic disk, and records the data into a file on the accessed region of the magnetic disk. The amount of the data recorded into the file corresponds to the output-data length. When the data is recorded into the file, the output control means writes a signal, which represents a state where the data is being outputted, into the output state storage means. After the recording of the data into the file has been completed, the output control means writes a signal, which represents a state where the data has been outputted, into the output state storage means. In the output state storage means, the signal representing the state where the data has been outputted replaces the signal representing the state where the data is being outputted. If power supply is interrupted before the recording of the data into the file is completed, the signal representing the state where the data is being outputted remains in the output state storage means.
In Japanese patent application 6-19767, when the magnetic disk controller is restarted, the file restoration means inspects the state represented by the signal stored in the output state storage means. If the state means that the data is being outputted, the file restoration means provides the output control means with a data re-recording request. The output control means implements a data re-recording process in response to the data re-recording request as follows. The output control means reads out the information of the designated output position and the output-data length from the output control information storage means. The output control means accesses the region of the magnetic disk which agrees with the designated output position. The output control means transfers the data from the output data storage means to the magnetic disk again, and re-records the data into the file on the accessed region of the magnetic disk. After the re-recording of the data into the file has been completed, the output control means writes a signal, which represents a state where the data has been outputted, into the output state storage means. Accordingly, in the case where power supply is interrupted during the recording of data into a file on the magnetic disk, data in the file on the magnetic disk can be restored after the interruption of power supply terminates.
A typical recording disk has a recording track divided into sectors to which different addresses are assigned respectively. Every sector corresponds to a minimum unit of data in recording and reproducing information on and from the recording disk. In general, data on a recording disk includes user data and correction-code (ECC) information. The data on the recording disk is divided into blocks (ECC blocks) each having a set of a user data piece and an ECC information piece. During playback, error correction of the user data is implemented block by block. An ECC information piece in every block is predetermined depending on a user data piece in the same block to permit error correction thereof.
In some recording disks, every ECC block of recorded data extends over a plurality of sectors. During the updating of data on such a recording disk, old data is replaced by new data in every ECC block. It is assumed that power supply is interrupted during the replacement of old data by new data in an ECC block. In this case, portions of the new data are recorded on former sectors in the ECC block while portions of the old data remain on latter sectors therein. As a result, there is a discrepancy between a user data piece and an ECC information piece in that ECC block. It is difficult to correctly reproduce a user data piece from such a wrong ECC block since an ECC information piece therein is inconsistent with the user data piece. Thus, it is also difficult to update a portion of the user data piece in a specified sector among sectors of the wrong ECC block.
It is a first object of this invention to provide a method of recording and reproducing information on and from a disk-shaped recording medium which is less adversely affected by interruption of power supply.
It is a second object of this invention to provide an apparatus for recording and reproducing information on and from a disk-shaped recording medium which is less adversely affected by interruption of power supply.
A first aspect of this invention provides a method of recording and reproducing information on and from a disk ECC-block by ECC-block. Every ECC block is composed of plural sectors. The method comprises the steps of generating a recording command containing information of a recording position on the disk; storing the information of the recording position into a nonvolatile memory; recording data on the disk in response to the recording command; in cases where power supply is turned on after interruption of power supply terminates, detecting a specified ECC block from the information stored in the nonvolatile memory, the specified ECC block being adversely affected by the interruption of power supply during the recording of data on the disk; generating one of a reproducing command and a verify command for at least one sector of the specified ECC block; reproducing data from the specified ECC block on the disk in response to the one of the reproducing command and the verify command; deciding whether or not the reproduction of data from the specified ECC block succeeds or fails; and in cases where it is decided that the reproduction of data from the specified ECC block fails, recording data on a whole of the specified ECC block to convert the specified ECC block into a normal ECC block.
A second aspect of this invention provides a method of recording and reproducing information on and from a disk ECC-block by ECC-block. Every ECC block is composed of plural sectors. The method comprises the steps of generating a recording command for a specified ECC block on the disk, the recording command containing information of a recording position on the disk and information of a recording size, the specified ECC block having sectors designated by the recording command and sectors undesignated by the recording command; writing the information of the recording position and the information of the recording size into a first nonvolatile memory; calculating the undesignated sectors among sectors in the specified ECC block; reproducing existing data from the calculated undesignated sectors in the specified ECC block on the disk; writing the reproduced existing data into a second nonvolatile memory; recording record data on the designated sectors in the specified ECC block on the disk in response to the recording command; writing the record data into a third nonvolatile memory; and in cases where power supply is turned on after interruption of power supply terminates, combining the existing data in the second nonvolatile memory and the record data in the third nonvolatile memory into restored data and recording the restored data on a whole of the specified ECC block on the disk in response to the information of the recording position and the information of the recording size in the first nonvolatile memory.
A third aspect of this invention provides a method of recording and reproducing information on and from a disk ECC-block by ECC-block. The method comprises the steps of recording disk identification information on a specified position on a disk; writing the disk identification information and information of the specified position into a nonvolatile memory; in cases where power supply is turned on after interruption of power supply terminates, reproducing information from a position on a disk which corresponds to the specified position represented by the information in the nonvolatile memory; deciding whether or not the reproduced information and the disk identification information in the nonvolatile memory are equal to each other; and when it is decided that the reproduced information and the disk identification information in the nonvolatile memory are equal to each other, updating a wrong ECC block on the disk into a normal ECC-block, the wrong ECC block being caused by the interruption of power supply during data recording on the disk.
A fourth aspect of this invention provides a method of recording and reproducing information on and from a disk ECC-block by ECC-block. The method comprises the steps of detecting whether or not power supply from a main power source to a disk drive is interrupted; and when it is detected that the power supply from the main power source to the disk drive is interrupted, using an auxiliary power source instead of the main power source and maintaining operation of the disk drive until the disk drive completes recording of data on a whole of a present ECC block on the disk.
A fifth aspect of this invention provides an apparatus for recording and reproducing information on and from a disk ECC-block by ECC-block. Every ECC block is composed of plural sectors. The apparatus comprises means for generating a recording command containing information of a recording position on the disk; a nonvolatile memory; means for storing the information of the recording position into the nonvolatile memory; means for recording data on the disk in response to the recording command; means for, in cases where power supply is turned on after interruption of power supply terminates, detecting a specified ECC block from the information stored in the nonvolatile memory, the specified ECC block being adversely affected by the interruption of power supply during the recording of data on the disk; means for generating one of a reproducing command and a verify command for at least one sector of the specified ECC block; means for reproducing data from the specified ECC block on the disk in response to the one of the reproducing command and the verify command; means for deciding whether or not the reproduction of data from the specified ECC block succeeds or fails; and means for, in cases where it is decided that the reproduction of data from the specified ECC block fails, recording data on a whole of the specified ECC block to convert the specified ECC block into a normal ECC block.
A sixth aspect of this invention provides an apparatus for recording and reproducing information on and from a disk ECC-block by ECC-block. Every ECC block is composed of plural sectors. The apparatus comprises means for generating a recording command for a specified ECC block on the disk, the recording command containing information of a recording position on the disk and information of a recording size, the specified ECC block having sectors designated by the recording command and sectors undesignated by the recording command; a first nonvolatile memory; means for writing the information of the recording position and the information of the recording size into the first nonvolatile memory; means for calculating the undesignated sectors among sectors in the specified ECC block; means for reproducing existing data from the calculated undesignated sectors in the specified ECC block on the disk; a second nonvolatile memory; means for writing the reproduced existing data into the second nonvolatile memory; means for recording record data on the designated sectors in the specified ECC block on the disk in response to the recording command; a third nonvolatile memory; means for writing the record data into the third nonvolatile memory; and means for, in cases where power supply is turned on after interruption of power supply terminates, combining the existing data in the second nonvolatile memory and the record data in the third nonvolatile memory into restored data and recording the restored data on a whole of the specified ECC block on the disk in response to the information of the recording position and the information of the recording size in the first nonvolatile memory.
A seventh aspect of this invention provides an apparatus for recording and reproducing information on and from a disk ECC-block by ECC-block. The apparatus comprises means for recording disk identification information on a specified position on a disk; a nonvolatile memory; means for writing the disk identification information and information of the specified position into the nonvolatile memory; means for, in cases where power supply is turned on after interruption of power supply terminates, reproducing information from a position on a disk which corresponds to the specified position represented by the information in the nonvolatile memory; means for deciding whether or not the reproduced information and the disk identification information in the nonvolatile memory are equal to each other; and means for, when it is decided that the reproduced information and the disk identification information in the nonvolatile memory are equal to each other, updating a wrong ECC block on the disk into a normal ECC block, the wrong ECC block being caused by the interruption of power supply during data recording on the disk.
An eighth aspect of this invention provides an apparatus for recording and reproducing information on and from a disk ECC-block by ECC-block. The apparatus comprises a disk drive; a main power source connected to the disk drive; an auxiliary power source connected to the disk drive; means for detecting whether or not power supply from the main power source to the disk drive is interrupted; and means for, when it is detected that the power supply from the main power source to the disk drive is interrupted, using the auxiliary power source instead of the main power source and maintaining operation of the disk drive until the disk drive completes recording of data on a whole of a present ECC block on the disk.